
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import cv2
import pytesseract

driver = webdriver.Firefox()

try:
    # 打开登录界面
    driver.get("http://localhost:8013/login?redirect=%2Fdashboard")
    # 定位用户名输入框并输入用户名
    username_input = driver.find_element(By.XPATH,'//*[@id="app"]/div/form/div[1]/div/div/input').send_keys("")
    password_input = driver.find_element(By.XPATH,'//*[@id="app"]/div/form/div[2]/div/div/input').send_keys("")
    while input():
        if input() == 'ok':
            break

    print('hello')
    time.sleep(5)
    driver.find_element(By.XPATH,'//*[@id="app"]/div/form/div[4]/div/button').click()



finally:
    # 关闭浏览器
    time.sleep(30)
    driver.quit()






